package com.itcast.demo.valueTest;

import lombok.ToString;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@ToString
public class ValueInjectionExample {
    @Value("${app1.name}")
    private String appName;
    @Value("${app1.timeout}")
    private int timeout;
    @Value("${app1.unkown.property:默认值}")
    private String unkownProperty;
//    @Value("#{${app1.configMap}}")
//    private Map<String,String> configMap;
//    @Value("#{${app1.servers}}")
    @Value("${app1.servers}")
    private String servers;
    @Value("${JAVA_HOME:默认环境变量}")
    private String javaHome;
}
